import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import getters from './getters'


Vue.use(Vuex);
let plugins = [];
import createPersistedState from 'vuex-persistedstate';
const vuexLocal = createPersistedState({
  storage: {
    getItem: key => uni.getStorageSync(key),
    setItem: (key, value) => uni.setStorageSync(key, value),
    removeItem: key => uni.removeStorageSync(key)
  }
});
plugins = [vuexLocal];
const store = new Vuex.Store({
  modules: {
    user
  },
  state: {},
  mutations: {},
  actions: {},
  getters,
  plugins
})

export default store
